﻿<h2 class="text-center">管理【{{group.GroupName}}】的用户</h2>
<div>
    <div class="form-inline pull-right">
        <button class="btn btn-info waves-effect" ng-click="list.GetPageData(paginationConf.currentPage, paginationConf.itemsPerPage);">
            <span class="glyphicon glyphicon-refresh"></span>
        </button>
        <div class="input-group">
            <span class="input-group-addon">选择应用：</span>
            <div class="ui fluid search selection dropdown apps" style="width: 200px">
                <input name="apps" type="hidden" id="apps">
                <i class="dropdown icon"></i>
                <div class="default text">选择应用</div>
                <div class="menu">
                    <div class="item" ng-repeat="item in apps track by $index" data-value="{{item.AppId}}">{{item.AppName}}</div>
                </div>
            </div>
        </div>
        <div class="input-group">
            <span class="input-group-addon">全局搜索：</span>
            <div class="fg-line">
                <input type="text" class="form-control" ng-change="search(kw)" ng-model="kw" placeholder="全局搜索" />
            </div>
        </div>
    </div>
    <h3 class="text-danger">不属于【{{group.GroupName}}】的用户</h3>
    <table ng-table="list.tableParams" class="table table-bordered table-hover table-condensed editable-table listTable" ng-form="list.tableForm" disable-filter="list.isAdding" tracked-table="list.tableTracker">
        <tr ng-repeat="row in $data" ng-form="rowForm" tracked-table-row="row" ng-class="{'text-danger':row.IsMaster}">
            <td title="'用户名'" filter="{Username: 'text'}" sortable="'Username'">
                {{row.Username}}
            </td>
            <td title="'手机号码'" filter="{PhoneNumber: 'text'}">
                {{row.PhoneNumber}}
            </td>
            <td title="'邮箱'" filter="{Email: 'text'}">
                {{row.Email}}
            </td>
            <td title="'锁定状态'">
                <label class="el-switch el-switch-red">
                    <input type="checkbox" name="switch" ng-model="row.Locked">
                    <span class="el-switch-style"></span>
                </label>
            </td>
            <td title="'管理员'">
                <label class="el-checkbox">
                    <input type="checkbox" name="check" ng-model="row.IsMaster">
                    <span class="el-checkbox-style"></span>
                </label>
            </td>
            <td title="'注册时间'" filter="{RegisterTime: 'text'}" sortable="'RegisterTime'">
                {{row.RegisterTime|date:'yyyy-MM-dd HH:mm'}}
            </td>
            <td title="'最后登录时间'" filter="{LastLoginTime: 'text'}" sortable="'LastLoginTime'">
                {{row.LastLoginTime|date:'yyyy-MM-dd HH:mm'}}
            </td>
            <td title="'权限配置'">
                <div class="btn-group">
                    <button class="btn btn-info btn-sm waves-effect" ng-click="list.addUser(row)">
                        添加
                    </button>
                </div>
                <a class="btn btn-info btn-sm waves-effect" ng-href="#/user/authority/{{row.Id}}?appid={{appid}}">
                    最终配置
                </a>
            </td>
            <td title="'首选项'">
                <div class="btn-group">
                    <a class="btn btn-danger btn-sm waves-effect" ng-href="#/user/apps/{{row.Id}}">
                        配置应用
                    </a>
                    <a class="btn btn-primary btn-sm waves-effect" ng-href="#/user/roles/{{row.Id}}">
                        角色
                    </a>
                    <a class="btn btn-success btn-sm waves-effect" ng-href="#/user/permissions/{{row.Id}}">
                        临时权限
                    </a>
                </div>
            </td>
        </tr>
    </table>
</div>
<div>
    <h3 class="text-success">已归属【{{group.GroupName}}】的用户</h3>
    <table ng-table="list.tableParams2" class="table table-bordered table-hover table-condensed editable-table listTable" ng-form="list.tableForm" disable-filter="list.isAdding" tracked-table="list.tableTracker">
        <tr ng-repeat="row in $data" ng-form="rowForm" tracked-table-row="row" ng-class="{'text-danger':row.IsMaster}">
            <td title="'用户名'" filter="{Username: 'text'}" sortable="'Username'">
                {{row.Username}}
            </td>
            <td title="'手机号码'" filter="{PhoneNumber: 'text'}">
                {{row.PhoneNumber}}
            </td>
            <td title="'邮箱'" filter="{Email: 'text'}">
                {{row.Email}}
            </td>
            <td title="'锁定状态'">
                <label class="el-switch el-switch-red">
                    <input type="checkbox" name="switch" ng-model="row.Locked">
                    <span class="el-switch-style"></span>
                </label>
            </td>
            <td title="'管理员'">
                <label class="el-checkbox">
                    <input type="checkbox" name="check" ng-model="row.IsMaster">
                    <span class="el-checkbox-style"></span>
                </label>
            </td>
            <td title="'注册时间'" filter="{RegisterTime: 'text'}" sortable="'RegisterTime'">
                {{row.RegisterTime|date:'yyyy-MM-dd HH:mm'}}
            </td>
            <td title="'最后登录时间'" filter="{LastLoginTime: 'text'}" sortable="'LastLoginTime'">
                {{row.LastLoginTime|date:'yyyy-MM-dd HH:mm'}}
            </td>
            <td title="'权限配置'">
                <div class="btn-group">
                    <button class="btn btn-danger btn-sm waves-effect" ng-click="list.removeUser(row)">
                        移除
                    </button>
                    <a class="btn btn-info btn-sm waves-effect" ng-href="#/user/authority/{{row.Id}}?appid={{appid}}">
                        最终配置
                    </a>
                </div>
            </td>
            <td title="'首选项'">
                <div class="btn-group">
                    <a class="btn btn-danger btn-sm waves-effect" ng-href="#/user/apps/{{row.Id}}">
                        配置应用
                    </a>
                    <a class="btn btn-info btn-sm waves-effect" ng-href="#/user/groups/{{row.Id}}">
                        用户组
                    </a>
                    <a class="btn btn-primary btn-sm waves-effect" ng-href="#/user/roles/{{row.Id}}">
                        角色
                    </a>
                    <a class="btn btn-success btn-sm waves-effect" ng-href="#/user/permissions/{{row.Id}}">
                        临时权限
                    </a>
                </div>
            </td>
        </tr>
    </table>
    <tm-pagination conf="paginationConf"></tm-pagination>
</div>